#ifndef PPTPSOCKET_H
#define PPTPSOCKET_H

#include <QObject>
#include <QTcpSocket>
#include <QTimer>
#include "PptpMessage.h"

class PptpSocket : public QObject
{
    Q_OBJECT
public:
    explicit PptpSocket(QObject *parent = nullptr);
    explicit PptpSocket(QTcpSocket *socket, QObject *parent = nullptr);
    ~PptpSocket();
    void connectToHost(QString ip, QString port);
    void pptpWrite(QByteArray writeMessage);
    QTcpSocket *socket;

private:
    QByteArray buffer;
    int messageLength;
    // QByteArray xorEncryptDecrypt(const QByteArray &data, const QByteArray &key);

public slots:
    void onReadyRead();

signals:
    void pptpConnect();
    void pptpDisconnect();
    void readCompletedSignal(QByteArray readMessage);
};

#endif // PPTPSOCKET_H
